package com.xyoto.community.utils;

import com.xyoto.community.constant.CommonConstant;

/**
 * 图片工具类
 * Author: 廖振辉
 * Date: 2021/12/31
 * Description:
 * @author Administrator
 */
public class PictureUtils {

    /**
     * 给oss图片相对路径增加oss域名前缀
     * @author 廖振辉
     * @param path 图片相对路径
     * @return {@link String}
     */
    public static String addPrefix(String path){
        if (path != null && !path.startsWith("https://")){
            path = CommonConstant.OSS_DOMAIN_NAME + path;
        }
        return path;
    }
}
